package cn.lysj.framework.common.validate.entity;

import java.lang.annotation.Annotation;
import java.lang.reflect.Field;

public class Entity {
    private Annotation annotation; //注解类
    private Field field; //参数名
    private Object value; //参数值
    private boolean sort; //对注解排序
    private Class clazz; //参数所在的类的Class

    public Entity(Annotation annotation, Field field, Object value) {
        this.annotation = annotation;
        this.field = field;
        this.value = value;
    }

    public Entity(Annotation annotation, Field field, Object value, boolean sort) {
        this.annotation = annotation;
        this.field = field;
        this.value = value;
        this.sort = sort;
    }

    public Entity(Annotation annotation, Field field, Object value, boolean sort, Class clazz) {
        this.annotation = annotation;
        this.field = field;
        this.value = value;
        this.sort = sort;
        this.clazz = clazz;
    }

    public Annotation getAnnotation() {
        return annotation;
    }

    public void setAnnotation(Annotation annotation) {
        this.annotation = annotation;
    }

    public Field getField() {
        return field;
    }

    public void setField(Field field) {
        this.field = field;
    }

    public Object getValue() {
        return value;
    }

    public void setValue(Object value) {
        this.value = value;
    }

    public boolean isSort() {
        return sort;
    }

    public void setSort(boolean sort) {
        this.sort = sort;
    }

    public Class getClazz() {
        return clazz;
    }

    public void setClazz(Class clazz) {
        this.clazz = clazz;
    }

    @Override
    public String toString() {
        return "Entity{" +
                "annotation=" + annotation +
                ", field=" + field +
                ", value=" + value +
                ", sort=" + sort +
                ", clazz=" + clazz +
                '}';
    }
}

